<template>
	<div style="display: flex;flex-direction: column;" class="otherPage corporateOverview developmentHistoryInfo">
		<Header :selected="3"></Header>
		<div class="bannerArea">
			<div class="banner" :style="bgImg? 'background:url('+bgImg+') no-repeat;background-size:cover;':''">
			</div>
		</div>
		<Navigation v-loading="loading" :items="breadcrumbItems" :menus="menus" :checked="3" :bgColor="bgColor">
		</Navigation>
		<div class="content">
			<div class="content_bg">
				<el-row>
					<el-col class="developmentHistoryInfoTitle">
						{{data.title}}
					</el-col>
					<el-col class="developmentHistoryInfoDate">
					<!-- 	{{$t("releaseDate")}}{{data?"："+data.eventTime:""}} -->
					</el-col>
					<!-- <el-col class="developmentHistoryInfoCoverImage">
						<img :src="data.coverImage" style="width: 100%; height: 100%;" />
					</el-col> -->
					<el-col class="developmentHistoryInfoDescription" v-html="data.content.setWrap()">
						<!-- 		<div v-html="data.content"></div> -->
					</el-col>
				</el-row>
			</div>
		</div>
		<Footer></Footer>
	</div>
</template>

<script>
	import Header from '../../components/common/header/Header.vue'
	import Navigation from '../../components/common/navigation/Navigation.vue'
	import Footer from '../../components/common/footer/Footer.vue'
	import {
		corporateOverviewMenu
	} from '../../utils/menu.js'
	// 导入您需要的模块
	import Swiper from "swiper";
	export default {
		components: {
			Header,
			Navigation,
			Footer
		},
		data() {
			return {
				loading: true,
				bgImg: '', //头部banner，默认值已绑定，有背景自动切换
				bgColor: "white", //white/red
				menus: corporateOverviewMenu,
				breadcrumbItems: [{
						label: this.$t('home'),
						to: '/'
					},
					{
						label: this.$t('corporateOverview'),
						to: '/corporateOverview'
					},
					{
						label: this.$t('developmentHistory'),
						to: '/developmentHistory'
					}
				],
				hoverIndex: -1,
				data: {
					title: '',
					eventTime: '',
					content: ''
				}

			};
		},
		computed: {},
		created() {
			this.data.id = this.$route.query.id;
		},
		mounted() {
			this.initPage();
			this.bindBg()
			this.bindInfo().then(i => {
				this.$request.setImageMaxwidth("img");
			});
		},
		methods: {

			/**
			 * (1)	取发展历程详情部背景
			 */
			bindBg() {
				let params = {};
				let that = this;
				that.$request.getEnterpriseHonorTopImage(params).then(res => {
					this.bgImg = this.$request.getImgUrl() + res.data.fileUrl
				}).catch((error) => {
					console.log(error);
				});

			},
			/**
			 * (1)	获取发展历程详情
			 */
			bindInfo() {
				return new Promise((resolve, reject) => {
					let params = {
						developHistoryId: this.data.id
					};
					let that = this;
					that.$request.getDevelopHistoryDetail(params).then(res => {
						this.data = res.data
						this.loading = false;
						resolve();
					}).catch((error) => {
						console.log(error);
					});
				});
			},
			formatDate(date, format) {
				// 自定义日期格式化方法
				// 可以使用moment.js或其他日期处理库来进行格式化
			},

			initPage() {

			},


		}
	}
</script>

<style scoped>
	@import url("../../components/common/css/corporateOverview/companyProfile.css");

	.developmentHistoryInfoTitle {
		height: 40px;
		line-height: 40px;
		font-size: 20px;
		text-align: center;
		font-weight: 530;
		color: #333333;
	}

	.developmentHistoryInfoDate {
		text-align: center;
		height: 40px;
		line-height: 40px;
		font-weight: 400;
		color: #999999;
		line-height: 33px;
	}

	.developmentHistoryInfoCoverImage {
		width: 60%;
		margin: 0px 20%;
	}

	.developmentHistoryInfoDescription {
		font-weight: 400;
		color: #666666;
		line-height: 27px;
		overflow: hidden;
	}
</style>
